package malus.shaofeng.com.beiwomusic.model;

import org.json.JSONObject;

/**
 * Created by Administrator on 2015/3/11.
 */
public class TopicPost {
    private int post_id;
    private String title;
    private String content;
    private String image_uri;
    private int views;
    private int replies;
    private String create_time;
    private User user;
    public void parseJSON(JSONObject object){
        post_id=object.optInt("post_id");
        title=object.optString("title");
        content=object.optString("content");
        image_uri=object.optString("image_uri");
        views= object.optInt("views");
        replies=object.optInt("replies");
        create_time=object.optString("create_time");
        user=new User();
        if(!object.isNull("user")){
            user.parseJSON(object.optJSONObject("user"));
        }
    }

    public int getPost_id() {
        return post_id;
    }

    public void setPost_id(int post_id) {
        this.post_id = post_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImage_uri() {
        return image_uri;
    }

    public void setImage_uri(String image_uri) {
        this.image_uri = image_uri;
    }

    public int getViews() {
        return views;
    }

    public void setViews(int views) {
        this.views = views;
    }

    public int getReplies() {
        return replies;
    }

    public void setReplies(int replies) {
        this.replies = replies;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
